/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.magicland;

import java.util.ArrayList;


public class MissionsManager {
     
     private static ArrayList<Mission> missoes; 
     private static Mission currentMission;
     private static int curMissionIndex  ;
     

    /**
     * @return the currentMission
     */
    public static Mission getCurrentMission() {
        return currentMission;
    }

    
    public static void setCurrentMissionComplete() {//Mission aCurrentMission
//        currentMission = aCurrentMission;
//        
        for(Mission m: missoes){  
             if( currentMission.equals(m) ){
                // System.out.println("currentMission COMPLETEEEEE:"+m);
                  m.setMissaoCompleta(true);
                 break;
             }
         }
    }

     
     public MissionsManager() {
    
          missoes = new ArrayList<Mission>(); 
          
          
          missoes.add(new Mission("str_mission_1", "str_tree" ));
          
          
          missoes.add(new Mission("str_mission_2", "str_house" ));
          
          
          missoes.add(new Mission("str_mission_3", "str_troll" ));
          
          
          missoes.add(new Mission("str_mission_4", "str_plantation" ));
          
           
          missoes.add(new Mission("str_mission_5", "str_store" ));
          
    
}

     
     
     public Mission getNextMission() {
         currentMission = null;
         for(Mission m: missoes){  
             if(!m.isMissaoCompleta()){
                 currentMission =  m;
                 break;
             }
         }
         return currentMission; 
     }
     
     
     public void resetMissions() {
         currentMission = null;
         for(Mission m: missoes){  
             m.setMissaoCompleta(false);
         }
       //  return currentMission; 
     }
  
}

